home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d27
/
dupsplf.arc
/
DUPSPLF.EXE
/
arc
/
DUPSPLFC.PGM
< prev
Wrap
Text File
|
1988-01-25
|
5KB
|
98 lines
/********************************************************************/
/* Duplicate Spool File Member */
/* */
/* Mark S. Shashek 07-17-86 */
/********************************************************************/
PGM PARM(&FILE &FULLJOB &PRTFILE &OUTQ &SPLNBR)
DCL VAR(&FULLJOB) TYPE(*CHAR) LEN(26)
DCL VAR(&JOB) TYPE(*CHAR) LEN(10)
DCL VAR(&USER) TYPE(*CHAR) LEN(10)
DCL VAR(&JOBNBR) TYPE(*CHAR) LEN(6)
DCL VAR(&FILE) TYPE(*CHAR) LEN(10)
DCL VAR(&PRTFILE) TYPE(*CHAR) LEN(20)
DCL VAR(&PRTFILEN) TYPE(*CHAR) LEN(10)
DCL VAR(&PRTFILEL) TYPE(*CHAR) LEN(10)
DCL VAR(&OUTQ) TYPE(*CHAR) LEN(20)
DCL VAR(&OUTQN) TYPE(*CHAR) LEN(10)
DCL VAR(&OUTQL) TYPE(*CHAR) LEN(10)
DCL VAR(&SPLNBR) TYPE(*CHAR) LEN(6)
DCL VAR(&MSGID) TYPE(*CHAR) LEN(7)
DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(80)
MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ERROR))
/* Any Error */
CHGVAR VAR(&PRTFILEN) VALUE(%SST(&PRTFILE 1 10))
/* Extract File */
CHGVAR VAR(&PRTFILEL) VALUE(%SST(&PRTFILE 11 10))
/* Extract Library */
CHGVAR VAR(&OUTQN) VALUE(%SST(&OUTQ 1 10))
/* Extract Outq */
CHGVAR VAR(&OUTQL) VALUE(%SST(&OUTQ 11 10))
/* Extract Library */
CHGVAR VAR(&JOB) VALUE(%SST(&FULLJOB 1 10))
/* Extract Job */
CHGVAR VAR(&USER) VALUE(%SST(&FULLJOB 11 10))
/* Extract User */
CHGVAR VAR(&JOBNBR) VALUE(%SST(&FULLJOB 21 6))
/* Extract Job Number */
CHKOBJ OBJ(DUPSPLP.QTEMP) OBJTYPE(*FILE)
/* Check for Temp PF */
MONMSG MSGID(CPF9801) EXEC(DO) /* Does not Exist */
CRTPF FILE(DUPSPLP.QTEMP) RCDLEN(199)
/* Create File */
ENDDO
IF COND(&FULLJOB *EQ '*') THEN(DO) /* Same Job */
CPYSPLF FILE(&FILE) +
TOFILE(DUPSPLP.QTEMP) +
SPLNBR(&SPLNBR) +
CTLCHAR(*FCFC)
/* Copy to Temp PF */
ENDDO
ELSE CMD(DO) /* Specific Job Name to be Used */
IF COND(&USER *EQ ' ') THEN(DO)
CHGVAR VAR(&USER) VALUE('*N')
ENDDO
IF COND(&JOBNBR *EQ ' ') THEN(DO)
CHGVAR VAR(&JOBNBR) VALUE('*N')
ENDDO
CPYSPLF FILE(&FILE) +
TOFILE(DUPSPLP.QTEMP) +
JOB(&JOB.&USER.&JOBNBR) +
SPLNBR(&SPLNBR) +
CTLCHAR(*FCFC)
/* Copy to Temp PF */
ENDDO
IF COND(&OUTQN *EQ '*PRTFILE') THEN(DO)
/* Use Same Outq */
OVRPRTF FILE(QSYSPRT) +
TOFILE(&PRTFILEN.&PRTFILEL) +
CTLCHAR(*FCFC)
/* Override with FCFC */
ENDDO
ELSE /* Use Named Outq and FCFC */
OVRPRTF FILE(QSYSPRT) +
TOFILE(&PRTFILEN.&PRTFILEL) +
CTLCHAR(*FCFC) +
OUTQ(&OUTQN.&OUTQL)
CPYF FROMFILE(DUPSPLP.QTEMP) +
TOFILE(QSYSPRT)
/* Duplicate File */
SNDPGMMSG MSG('Spool File ' +
*CAT &JOB +
*TCAT ' duplicated') +
MSGTYPE(*COMP)
RETURN /* Good Completion */
ERROR: /* Any *EXCP msg is returned as an escape */
RCVMSG MSGTYPE(*EXCP) +
MSGDTA(&MSGDTA) +
MSGID(&MSGID)
SNDPGMMSG MSGID(&MSGID) +
MSGF(QCPFMSG) +
MSGDTA(&MSGDTA) +
MSGTYPE(*ESCAPE)
ENDPGM